home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / apport / package-hooks / source_jockey.py < prev    next >
Encoding:
Python Source  |  2009-04-07  |  571 b   |  21 lines

  1. import os.path, os
  2.  
  3. import apport.hookutils
  4.  
  5. XORG_CONF = '/etc/X11/xorg.conf'
  6.  
  7. def add_info(report):
  8.     try:
  9.         report['XorgConf'] = open(XORG_CONF).read()
  10.     except IOError:
  11.         pass
  12.  
  13.     report['Devices'] = ''
  14.     for dirpath, dirnames, filenames in os.walk("/sys/devices"):
  15.         if "modalias" in filenames:
  16.             modalias = open(os.path.join(dirpath, "modalias")).read().strip()
  17.             report['Devices'] += modalias + "\n"
  18.  
  19.     apport.hookutils.attach_file_if_exists(report, '/var/log/jockey.log')
  20.     apport.hookutils.attach_hardware(report)
  21.